/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: AnalyzerSkeleton.java 412 2007-02-10 18:34:03Z jack.rybicki $
 */
package logmatcher.analyzers;

import logmatcher.Configurable;
import logmatcher.InitializationException;
import logmatcher.LogEventProducer;
import logmatcher.LogEventListener;
import logmatcher.Utils;

import org.apache.commons.configuration.Configuration;


/**
 *  Base class for all analyzers.
 *
 *  @version $Revision: 412 $
 */
public abstract class AnalyzerSkeleton implements Configurable, LogEventListener {
    //~ Methods --------------------------------------------------------------------------------------------------------

    /**
     *  
     *  @see logmatcher.Configurable#configure(org.apache.commons.configuration.Configuration, java.lang.String)
     */
    public final void configure(Configuration config, String id)
        throws InitializationException {
        Utils.autoConfigure(this, config, id);

        configureAnalyzer(config, id);
    }


    /**
     *  Should be overridden to provide analyzer-specific configuration.
     *
     *  @param config configuration object reference.
     *  @param id identifier of this analyzer.
     */
    protected void configureAnalyzer(Configuration config, String id) {
        // by default there is no need to configure anything
    }
}
